package com.md.utils;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;



/**
 * Created by Administrator on 2019/1/14 0014.
 */

public class UpdateVersionDialog extends Dialog {

    private Context context;
    private Activity activity;
    private String content;
    private String contentyw;

    public UpdateVersionDialog(@NonNull final Context context, final Activity activity,
                               final String content, final String contentyw, final String url, final boolean isForce) {
        super(context);
        this.contentyw = contentyw;
        this.content = content;
        this.context = context;
        this.activity = activity;

//        LayoutInflater inflater = getLayoutInflater();
//        View view = inflater.inflate(R.layout.dialog_update_version,null);
//        TextView webView = view.findViewById(R.id.webView);
//        TextView tip = view.findViewById(R.id.tip);
//        View cancel =  view.findViewById(R.id.cancel);
//        View update = view.findViewById(R.id.update);
//        if (PreferencesUtils.getInt(context, "languare") == ChangeLanguageHelper.CHANGE_LANGUAGE_CHINA) {
//            webView.setText(content);
//        } else {
//            webView.setText(contentyw);
//        }
////
//        if (isForce){
//            cancel.setVisibility(View.GONE);/*强制*/
//        }else{
//            cancel.setVisibility(View.VISIBLE);
//        }
////
//        cancel.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                dismiss();
//            }
//        });
//        update.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                dismiss();
//                new Download_NohttpUtils().downMyfile(url, activity, isForce);
//            }
//        });
//
//
//
//        this.setContentView(view);
//        this.setCancelable(false);
//        this.setCanceledOnTouchOutside(false);
//
//        Window window = this.getWindow();
//        window.setGravity(Gravity.CENTER);
//        window.setBackgroundDrawableResource(R.color.transparent);
//        window.setWindowAnimations(R.style.ActionSheetDialogStyle);
//        window.setLayout(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);

    }


}
